package com.cncf.controller.user;

import com.cncf.response.ResponseData;
import com.cncf.service.ReportService;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author zj
 */
@Api(value = "User", description = "用户端企业的相关接口")
@Controller
@RequestMapping("/user/report")
public class UserReportController {
    private static final Log logger = LogFactory.getLog(UserReportController.class);
    @Autowired
    private ReportService reportService;

    @ApiOperation(value = "根据报告id获取报告文件url", notes = "")
    @RequestMapping(value = "getReportFilePathById", method = {RequestMethod.GET})
    @ResponseBody
    public ResponseData<String> getReportFilePathById(@ApiParam("报告id") @RequestParam("id") String id){
        ResponseData<String> responseData=new ResponseData<>();
        String url=reportService.getReportFilePathById(id);
        responseData.jsonFill(1,null,url);
        return responseData;
    }

}
